1. Field of the Invention
This invention relates to an image forming apparatus in which a cartridge provided with a memory is capable of being removably inserted. More particularly, the invention relates to the writing of data to the memory of the cartridge.
2. Description of the Related Art
A printer such as described in the specifications of Japanese Patent Application Laid-Open (KOKAI) Nos. 4-299375 and 6-130754 uses a cartridge, which is a combination of a drum and toner container, fitted with a non-volatile memory to which data indicating drum life and number of prints made is written. Drum life and amount of remaining toner are sensed by referring to this data. For sake of safety, there are instances where the data is written to plurality of areas and managed as a plurality of data sets. A data set for which an error has occurred is not used.
However, in case where error in a data set is detected as by a checksum, it is not possible to determine whether the error occurred because of a malfunction in the non-volatile memory, such as an EEPROM, itself or because of an incomplete write operation as caused by turning off a power supply while the writing of data to the non-volatile memory was in progress. Consequently, any data set for which an error has occurred is not used across the board. Accordingly, a considerably number of data sets having identical data content must be prepared on the assumption that a write failure as caused by turning off a power supply may occur repeatedly.
Further, a problem that arises when a data set develops an error is how to select a correct data set in order to effect recovery of the faulty data set.
An object of the present invention is to provide an image forming apparatus and a method of controlling the image forming apparatus that solve the aforementioned problems.
Another object of the present invention is to provide an image forming apparatus, as well as a method of controlling this apparatus, in which the status of a cartridge can be judged in accurate fashion and redundancy of data for managing the cartridge can be reduced.
A further object of the present invention is to provide an image forming apparatus, as well as a method of controlling this apparatus, in which recovery from error in a data set that has been stored in memory can be achieved easily and reliably.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.